import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        component: HomeView,
        redirect: '/sys-admin/index',
        children: [
            {
                path: '/sys-admin/index',
                component: () => import('../views/sys-admin/SystemAdminIndex.vue')
            },
            /*财务板块*/
            {
                path: '/sys-admin/finance/Receive',
                component: () => import('../views/sys-admin/finance/Receive.vue')
            },
            {
                path: '/sys-admin/finance/ReceiveAdd',
                component: () => import('../views/sys-admin/finance/ReceiveAdd.vue')
            },
            {
                path: '/sys-admin/finance/FixAsset',
                component: () => import('../views/sys-admin/finance/FixedAsset.vue')
            },
            {
                path: '/sys-admin/finance/FixedAssetAdd',
                component: () => import('../views/sys-admin/finance/FixedAssetAdd.vue')
            },
            {
                path: '/sys-admin/finance/PayRoll',
                component: () => import('../views/sys-admin/finance/PayAccount.vue')
            },
            {
                path: '/sys-admin/finance/PayRollAdd',
                component: () => import('../views/sys-admin/finance/PayAccountAdd.vue')
            },
            {
                path: '/sys-admin/finance/PayRollEditOnline',
                component: () => import('../views/sys-admin/finance/PayAccountEditOutline.vue')
            },
            /*销售板块*/
            {
                path: '/sys-admin/custom/Manage',
                component: () => import('../views/sys-admin/custom/Manage.vue')
            },
            {
                path: '/sys-admin/custom/ManageAdd',
                component: () => import('../views/sys-admin/custom/ManageAdd.vue')
            },
            {
                path: '/sys-admin/custom/Sales',
                component: () => import('../views/sys-admin/custom/Sales.vue')
            },
            {
                path: '/sys-admin/custom/SalesAdd',
                component: () => import('../views/sys-admin/custom/SalesAdd.vue')
            },
            {
                path: '/sys-admin/custom/Agreement',
                component: () => import('../views/sys-admin/custom/Agreement.vue')
            },
            {
                path: '/sys-admin/custom/AgreementAdd',
                component: () => import('../views/sys-admin/custom/AgreementAdd.vue')
            },
            /*采购管理*/
            {
                path: '/sys-admin/purchase/Application',
                component: () => import('../views/sys-admin/purchase/Application.vue')
            },
            {
                path: '/sys-admin/purchase/ApplicationAdd',
                component: () => import('../views/sys-admin/purchase/ApplicationAdd.vue')
            },
            {
                path: '/sys-admin/purchase/oderAndInvoice',
                component: () => import('../views/sys-admin/purchase/oderAndInvoice/oderAndInvoice.vue')
            },
            {
                path: '/sys-admin/purchase/oderAndInvoiceAdd0',
                component: () => import('../views/sys-admin/purchase/oderAndInvoice/oderAndInvoiceAdd0.vue')
            },
            // {
            //     path: '/sys-admin/purchase/oderAndInvoiceAdd2',
            //     component: () => import('../views/sys-admin/purchase/oderAndInvoice/oderAndInvoiceAdd2.vue')
            // },
            // {
            //     path: '/sys-admin/purchase/oderAndInvoiceAdd3',
            //     component: () => import('../views/sys-admin/purchase/oderAndInvoice/oderAndInvoiceAdd3.vue')
            // },
            // {
            //     path: '/sys-admin/purchase/oderAndInvoiceAdd4',
            //     component: () => import('../views/sys-admin/purchase/oderAndInvoice/oderAndInvoiceAdd4.vue')
            // },
            {
                path: '/sys-admin/purchase/Suppliers',
                component: () => import('../views/sys-admin/purchase/Suppliers.vue')
            },
            {
                path: '/sys-admin/purchase/SuppliersAdd',
                component: () => import('../views/sys-admin/purchase/SuppliersAdd.vue')
            },
            /*生产管理*/
            {
                path: '/sys-admin/produce/Progress',
                component: () => import('../views/sys-admin/produce/Progress.vue')
            },
            {
                path: '/sys-admin/produce/ProgressAdd',
                component: () => import('../views/sys-admin/produce/ProgressAdd.vue')
            },
            {
                path: '/sys-admin/produce/Material',
                component: () => import('../views/sys-admin/produce/Material.vue')
            },
            {
                path: '/sys-admin/produce/MaterialAdd',
                component: () => import('../views/sys-admin/produce/MaterialAdd.vue')
            },
            {
                path: '/sys-admin/produce/Equipment',
                component: () => import('../views/sys-admin/produce/Equipment.vue')
            },
            {
                path: '/sys-admin/produce/EquipmentAdd',
                component: () => import('../views/sys-admin/produce/EquipmentAdd.vue')
            },
            /*仓库管理*/
            {
                path: '/sys-admin/warehouse/Quality',
                component: () => import('../views/sys-admin/warehouse/Quality.vue')
            },
            {
                path: '/sys-admin/warehouse/QualityAdd',
                component: () => import('../views/sys-admin/warehouse/QualityAdd.vue')
            },
            {
                path: '/sys-admin/warehouse/Category',
                component: () => import('../views/sys-admin/warehouse/Category.vue')
            },
            {
                path: '/sys-admin/warehouse/CategoryAdd',
                component: () => import('../views/sys-admin/warehouse/CategoryAdd.vue')
            },
            /*设置*/
            /*测试*/
            {
                path: '/sys-admin/adminDept/DeptADD',
                component: () => import('../views/sys-admin/adminDept/DeptAdd.vue')
            },
            {
                path: '/sys-admin/adminDept/Dept',
                component: () => import('../views/sys-admin/adminDept/DeptList.vue')
            },
            {
                path: '/sys-admin/adminDept/AdminAdd',
                component: () => import('../views/sys-admin/adminDept/AdminAdd.vue')
            },
            {
                path: '/sys-admin/adminDept/AdminList',
                component: () => import('../views/sys-admin/adminDept/AdminList.vue')
            },
            {
                path: '/sys-admin/adminDept/Permission',
                component: () => import('../views/sys-admin/adminDept/PermissionList.vue')
            },
            {
                path: '/sys-admin/adminDept/PermissionAdd',
                component: () => import('../views/sys-admin/adminDept/PermissionAdd.vue')
            },
            {
                path: '/sys-admin/adminDept/Role',
                component: () => import('../views/sys-admin/adminDept/RoleList.vue')
            },
            {
                path: '/sys-admin/adminDept/RoleAdd',
                component: () => import('../views/sys-admin/adminDept/RoleAdd.vue')
            }
        ],
    }, {
        path: '/login',
        component: () => import('../views/LoginView.vue')
    }, {
        path: '/protocol',
        component: () => import('../views/Protocol.vue')
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
